﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<style>
	.classRadio{
	float:right;
	width:50px;
	margin-left:-30px"
	}
</style>
    <base href="<%=basePath%>">
    <%@ include file="topa.jsp" %>
    <!-- jsp文件头和头部 -->
    <script src='static/js/jquery-1.9.1.min.js'></script>
    <script type="text/javascript" src="static/js/myjs/head.js${getTime}"></script>
    <script type="text/javascript" src="static/js/layer.js"></script>
    <link rel="stylesheet" href="static/css/layui.css" media="all">
    <script type="text/javascript">
        $(function () {
            $("#createContract").click(function () {

                //提交表单
                layer.confirm('确定将任务分配吗?', {
                    btn: ['是的', '再想想']
                    //按钮
                }, function () {
                    var asd = $("input[name='items']:checked").val();
                    var a = $(":radio:checked");
                    var len = a.length;
                    if (len > 0) {
                        var data = $("#pageForm").submit();
                        closeAply();
                        layer.msg('分配成功', {
                            icon: 1,
                            time: 2000,
                        });
                    } else {
                        layer.msg('请勾选催收员', {
                            icon: 2,
                            time: 2000,
                        });
                    }

                }, function () {
                    layer.msg('考虑清楚后再来找我哦', {
                        icon: 2,
                        time: 2000, //20s后自动关闭
                    });
                });
            })

        })
        function closeAply() {
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.close(index);
        }
    </script>
</head>
<body>
<div class="container-fluid" id="main-container">
    <div id="page-content" class="clearfix">
        <div class="row-fluid">
            <div class="row-fluid">

                <form action="<%=basePath%>taskdetails/pilianguser" method="post"
                      name="pageForm" id="pageForm">
                    <input type="hidden" id="fpId" name="fpId" value="${fpId }">
                    <input type="hidden" id="flag" name="flag" value="${flag }">
                    <input type="hidden" id="currentUserId" name="currentUserId" value="${currentUserId }">
                    <fieldset class="layui-elem-field">
                        <legend>任务数量：${len }</legend>
                        <div class="layui-field-box">
                            催收人员：
                                <!-- 开始循环 -->
                                <hr>
                                &emsp;<h3 style="background-color: gray;width: 50px;height: 30px">&emsp;S1</h3>
                                <c:choose>
                                    <c:when test="${not empty userpage1}">
                                   		<div class="checkbox" style="border:0px solid #ccc; width: 750PX; margin-left: 0px;">
											 <table><tr height="40px">
											 <c:forEach items="${userpage1}" var="var"  varStatus="status">
												<td style="border-left:0px"> &nbsp;&nbsp;&nbsp; 
												<input type="radio" style="border: 1px solid #000;opacity: 1; " id="${var.userid}"; name="userid" value="${var.userid}"/><label for="${var.userid}" style="float:right;width:70px;margin-left:-20px"> ${var.name}</label>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
												</td>
												  <c:if test="${status.count%5==0}">
													 </tr>
													  <tr height="40px">
													 </c:if>
											 </c:forEach>
													  </tr>
											 </table>
										 </div>
                                    </c:when>
                                    <c:otherwise>
                                        <tr class="main_info">
                                            <td colspan="100" class="center">没有相关数据</td>
                                        </tr>
                                    </c:otherwise>
                                </c:choose>
                             <hr>
                                <h3 style="background-color: gray;width: 50px;height: 30px">&emsp;S2</h3>
                                <c:choose>
                                    <c:when test="${not empty userpage2}">
                                   		<div class="checkbox" style="border:0px solid #ccc; width: 750PX; margin-left: 0px;">
											 <table><tr height="40px">
											 <c:forEach items="${userpage2 }" var="var"  varStatus="status">
												<td style="border-left:0px"> &nbsp;&nbsp;&nbsp;
												<input type="radio" style="border: 1px solid #000;opacity: 1; " id="${var.userid}"; name="userid" value="${var.userid}"/><label for="${var.userid}" style="float:right;width:70px;margin-left:-20px"> ${var.name}</label>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
												</td>
												  <c:if test="${status.count%5==0}">
													 </tr>
													  <tr height="40px">
													 </c:if>
											 </c:forEach>
													  </tr>
											 </table>
										 </div>
                                          <%--  <c:forEach items="${userpage }" var="var" varStatus="vs">
                                               <tr>
                                                   <td><input type="radio" id="userid" name=userid class="userById"
                                                              value="${var.userid }">${var.name}</td>
                                               </tr>
                                           </c:forEach> --%>
                                    </c:when>
                                    <c:otherwise>
                                        <tr class="main_info">
                                            <td colspan="100" class="center">没有相关数据</td>
                                        </tr>
                                    </c:otherwise>
                                </c:choose>
                                <hr>
                                <h3 style="background-color: gray;width: 50px;height: 30px">&emsp;S2+</h3>
                                <c:choose>
                                    <c:when test="${not empty userpage3}">
                                   		<div class="checkbox" style="border:0px solid #ccc; width: 750PX; margin-left: 0px;">
											 <table><tr height="40px">
											 <c:forEach items="${userpage3 }" var="var"  varStatus="status">
												<td style="border-left:0px"> &nbsp;&nbsp;&nbsp; 
												<input type="radio" style="border: 1px solid #000;opacity: 1; " id="${var.userid}"; name="userid" value="${var.userid}"/> <label for="${var.userid}" style="float:right;width:70px;margin-left:-20px">${var.name}</label>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
												</td>
												  <c:if test="${status.count%5==0}">
													 </tr>
													  <tr height="40px">
													 </c:if>
											 </c:forEach>
													  </tr>
											 </table>
										 </div>
                                          <%--  <c:forEach items="${userpage }" var="var" varStatus="vs">
                                               <tr>
                                                   <td><input type="radio" id="userid" name=userid class="userById"
                                                              value="${var.userid }">${var.name}</td>
                                               </tr>
                                           </c:forEach> --%>
                                    </c:when>
                                    <c:otherwise>
                                        <tr class="main_info">
                                            <td colspan="100" class="center">没有相关数据</td>
                                        </tr>
                                    </c:otherwise>
                                </c:choose>
                        </div>
                        <%-- <div class="page-header position-relative">
                            <table style="width: 100%;">
                                <tr>
                                    <td style="vertical-align: top;">
                                        <div class="pagination"
                                            style="float: right; padding-top: 0px; margin-top: 0px;">${page.pageStr}
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div> --%>
                        <button id="createContract" type="button" class="btn btn-primary">分派</button>
                        <button type="button" class="btn btn-default"
                                data-dismiss="modal" onclick="closeAply()">关闭
                        </button>

                    </fieldset>
                </form>


            </div>
        </div>
    </div>
</div>
<!-- 引入 -->
<script type="text/javascript">
    window.jQuery
    || document
        .write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");
</script>
<script src="static/js/bootstrap.min.js"></script>
<script src="static/js/ace-elements.min.js"></script>
<script src="static/js/ace.min.js"></script>
<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script>
<script type="text/javascript"
        src="static/js/bootstrap-datepicker.min.js"></script>
<script type="text/javascript" src="static/js/bootbox.min.js"></script>
<script type="text/javascript" src="static/js/jquery.tips.js"></script>
</body>
</html>

